package GUI;
import java.awt.*;
/**
 * Created with IntelliJ IDEA
 * Description:
 * User: YKH
 * Date: 2022-05-04
 * Time: 21:15
 * author:TestDome
 */
public class TestDome {
    public static void main(String[] args) {
        //展示多个窗口
        NumberFrame frame1 = new NumberFrame( 100,200,300,200,Color.black);
        NumberFrame frame2 = new NumberFrame( 400,200,300,200,Color.blue);
        NumberFrame frame3 = new NumberFrame( 400,600,300,200,Color.red);
        NumberFrame frame4 = new NumberFrame( 700,600,300,200,Color.darkGray);
    }
}

class NumberFrame extends Frame {
    private static int id = 0;
    public NumberFrame(int x,int y,int width,int heigh,Color color) {
        //设置标题
        super("myframe" + (++id));
        //设置窗口的可见性
        setVisible(true);
        //设置窗口大小
        setSize(width,heigh);
        //设置窗口颜色
        setBackground(color);
        //设置弹出的位置
        setLocation(x,y);
        //设置大小固定
        //setResizable(false);
    }
}
